import request from '../../utils/request';
import qs from 'qs';
//商户
export function getPageMerchants(data) {
  return request(`/api/merchant/getPageMerchants?${qs.stringify(data)}`);
}
export function getMyMerchant() {
  return request(`/api/merchant/getMyMerchant`);
}
export function deleteMerchants(data) {
  return request('/api/merchant/deleteMerchant',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function rebackMerchants(data) {
  return request('/api/merchant/rebackMerchant',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function addMerchantMerchants(data) {
  return request('/api/merchant/addMerchant',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function updateMerchantMerchants(data) {
  return request('/api/merchant/updateMerchant',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function chargeUpdate(data) {
  return request('/api/merchant/chargeMerchant',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}

//customer
export function getPageCustomers(data) {
  return request(`/api/customer/customerPage?${qs.stringify(data)}`);
}
export function deleteCustomers(data) {
  return request('/api/customer/deleteCustomer',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function addOrUpdateCustomer(data) {
  return request('/api/customer/updateCustomer',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}


//charge
export function getCustomer(data) {
  return request(`/api/customer/getMyCustomer?${qs.stringify(data)}`);
}
export function charge(data) {
  return request('/api/customer/charge',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function payCustomer(data) {
  return request('/api/customer/customerPay',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
export function outPay(data) {
  return request('/api/customer/outPay',{
    method:'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8'
    },
    body:JSON.stringify(data)
  });
}
